//package com.cloud.bssp.user.controller;
//
//import com.cloud.bssp.user.entity.TestEsDO;
//import com.cloud.bssp.user.entity.TestEsDO1;
//import com.cloud.bssp.user.service.TestEsService;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.domain.Page;
//import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.List;
//
///**
// * description: es测试控制器
// *
// * @author: weirx
// * @time: 2021/4/12 16:29
// */
//@Slf4j
//@RestController
//@RequestMapping("/es")
//public class TestEsController {
//
//    @Autowired
//    private ElasticsearchRestTemplate elasticsearchRestTemplate;
//
//    @Autowired
//    private TestEsService testEsService;
//
//    @RequestMapping("/getAll")
//    public List<TestEsDO> getAll() {
//        return testEsService.getAll();
//    }
//
//    @RequestMapping("/getById")
//    public TestEsDO getById(Long id) {
//        return testEsService.getById(id);
//    }
//
//    @RequestMapping("/save")
//    public TestEsDO save() {
//        TestEsDO testEsDO = new TestEsDO();
//        testEsDO.setId(1000L);
//        testEsDO.setName("elasticsearch");
//        testEsDO.setDesc("hello elasticsearch, 你好，elasticsearch");
//        return testEsService.save(testEsDO);
//    }
//
//    @RequestMapping("/delete")
//    public void delete(Long id) {
//        testEsService.delete(id);
//    }
//
//    @RequestMapping("/createIndex")
//    public void createIndex() {
//        elasticsearchRestTemplate.createIndex(TestEsDO1.class);
//        elasticsearchRestTemplate.putMapping(TestEsDO1.class);
//    }
//
//    @RequestMapping("/page")
//    public Page<TestEsDO> page() {
//        return testEsService.findByPageable();
//    }
//}